﻿@using DevExtreme.NETCore.Demos.Models.TreeList

@model IEnumerable<Employee>

@(Html.DevExtreme().TreeList<Employee>()
    .ID("employees")
    .DataSource(Model)
    .AllowColumnReordering(true)
    .KeyExpr("ID")
    .ParentIdExpr("HeadID")
    .Columns(column => {
        column.AddFor(m => m.FullName)
            .AllowReordering(false);

        column.AddFor(m => m.Title);

        column.AddFor(m => m.City);

        column.AddFor(m => m.State);

        column.AddFor(m => m.MobilePhone);

        column.AddFor(m => m.HireDate);
    })
    .ShowRowLines(true)
    .ShowBorders(true)
    .ColumnAutoWidth(true)
    .ExpandedRowKeys(new[] { 1 })
)
